<?php
$reg="[A-Za-z0-9._-]+@[a-zA-Z0-9]+\.[a-zA-Z.]{2,5}$";
$email="";
$echo="";
if(isset($_POST['submit']))
{
    if(isset($_POST['email']))
    {
        if(get_magic_quotes_gpc())
        {
        $email=  trim(mysqli_real_escape_string($_POST['email']));
       
        }
        if(preg_match($reg,$email)>0)
        {
            $echo="Nhập mail đúng";
        }
    }
}
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
    <fieldset>
        <legend>Check mail </legend>
        <div>
            <label>email cân kiểm tra</label>
            <input type="text" name="email" value="">
            <span><?php $echo; ?></span>
            <input type="submit" name="submit" value="Send">
        </div>
    </fieldset>
</form>